import request from '@/utils/request'

export function createOrderInfo(params) {
  return request({
    url: '/order/info',
    method: 'get',
    params
  })
}

/**
 * @description: 获取单据的产品信息
 * @param {*} params
 * @return {*}
 */
export function getOrderCommonProduction(params) {
  return request({
    url: '/order/common/production',
    method: 'get',
    params
  })
}

/**
 * @description: 获取单据的客户资料
 * @param {*} params:{fullname}
 * @return {*}
 */
export function getOrderCommonCustomer(params) {
  return request({
    url: '/order/common/customer',
    method: 'get',
    params
  })
}

/**
 * @description: 获取单据的供应商资料
 * @param {*} params:{fullname}
 * @return {*}
 */
export function getOrderCommonSullpier(params) {
  return request({
    url: '/order/common/supplier',
    method: 'get',
    params
  })
}

/**
 * @description: 获取部门资料
 * @param {*} params
 * @return {*}
 */
export function getOrderCommonDepart(params) {
  return request({
    url: '/order/common/depart',
    method: 'get',
    params
  })
}

/**
 * @description: 获取人员信息
 * @param {*} params
 * @return {*}
 */
export function getOrderCommonPerson(params) {
  return request({
    url: '/order/common/person',
    method: 'get',
    params
  })
}

/**
 * @description: 获取仓库信息
 * @param {*} params
 * @return {*}
 */
export function getOrderCommonWareHouse(params) {
  return request({
    url: '/order/common/warehouse',
    method: 'get',
    params
  })
}

/**
 * @description: 销售订单的单据类型
 * @param {*} params
 * @return {*}
 */
export function getOrderCommonXsddBilltype(params) {
  return request({
    url: '/order/common/xsdd/billtype',
    method: 'get',
    params
  })
}

/**
 * @description: 获取销售订单的转单信息
 * @param {*} params
 * @return {*}
 */
export function getTurnXsddOrder(params) {
  return request({
    url: '/order/common/turn/xsdd',
    method: 'get',
    params
  })
}

/**
 * @description: 获取采购订单的转单信息
 * @param {*} params
 * @return {*}
 */
export function getTurnCgddOrder(params) {
  return request({
    url: '/order/common/turn/cgdd',
    method: 'get',
    params
  })
}

/**
 * @description: 获取销售出库单的转单信息 -销售退货单
 * @param {*} params
 * @return {*}
 */
export function getTurnXsckdOrder(params) {
  return request({
    url: '/order/common/turn/xsckd',
    method: 'get',
    params
  })
}

/**
 * @description: 获取采购入库单的表身信息，作为采购退货单的载入
 * @param {*} params
 * @return {*}
 */
export function getTurnCgrkdOrder(params) {
  return request({
    url: '/order/common/turn/cgrkd',
    method: 'get',
    params
  })
}

/**
 * @description: 获取产品批号信息
 * @param {*} params：{prodid}
 * @return {*}
 */
export function getOrderCommonLotnumber(params) {
  return request({
    url: '/order/common/turn/lotnumber',
    method: 'get',
    params
  })
}

/**
 * @description: 检查库存数量，可用于不允许负库存出库
 * @param {*} params
 * @return {*}
 */
export function getOrderCommonValidateKcsl(params) {
  return request({
    url: '/order/common/validate/kcsl',
    method: 'get',
    params
  })
}

/**
 * @description: 获取单据类型  6：其他入库单  7：其他出库单
 * @param {*} params
 * @return {*}
 */
export function getOrderCommonOrdBillStyle(params) {
  return request({
    url: '/order/common/ordbill/style/list',
    method: 'get',
    params
  })
}

/**
 * @description: 更新现有总数量
 * @param {*} params
 * @return {*}
 */
export function updateAllamt(params) {
  return request({
    url: '/order/common/update/allamt',
    method: 'get',
    params
  })
}

/**
 * @description: 获取产品的库存存量信息
 * @param {*} params
 * @return {*}
 */
export function getProductStockDetail(params) {
  return request({
    url: '/order/common/product/stock/detail',
    method: 'get',
    params
  })
}

/**
 * @description: 生成批号
 * @param {*} params
 */
export function getLotNumber(params) {
  return request({
    url: '/order/common/lotnumber',
    params
  })
}
